package serializer;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;

/**
 * @author Administrator
 * @version V1.0
 * @Project hospital
 * @Package serializer
 * @Description: ${TODO}
 * @Date 2021/10/20 11:08
 */
public class CardIdInformation extends JsonSerializer<String> {


    @Override
    public void serialize(String s, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
       String str = s.substring(0,4) + "****" + s.substring(s.length()-4);
        jsonGenerator.writeString(str);
    }
}
